import {Box, Flex, Text} from 'native-base';
import React from 'react';
import {TouchableOpacity} from 'react-native';
import SvgIcons from '@/assets/svg';
import {useNavigation} from '@react-navigation/native';
export const Search = () => {
  const navigation = useNavigation();
  const handleInputPress = () => {
    navigation.navigate('Search' as never); // add 'as never' to cast the string to never type
  };
  return (
    <Box px="3" pb="3">
      <Flex direction="row" alignItems="center">
        <TouchableOpacity activeOpacity={1} style={{flex: 1}} onPress={handleInputPress}>
          <Box h={10} mr="3" justifyContent="center" borderWidth={1} opacity="40" bg="transparent" borderColor="#a3a3a3" borderRadius="full" pl="4">
            <Text color="#a3a3a3">搜索</Text>
          </Box>
        </TouchableOpacity>
        <TouchableOpacity activeOpacity={1} onPress={handleInputPress}>
          <SvgIcons.AddIcon width={24} height={24} color="#a3a3a3" />
        </TouchableOpacity>
      </Flex>
    </Box>
  );
};
